Super Mario Bros. 1 Music Data Documentation by Necrosaro (radimvice@geocities.com) -------------------------------------------- (Main music channels info) OK! i finally have some real time to write down all the info about mario music! (well, it's half past midnight, but I can stay up late) All ROM addresses are with header (just subtract 10 to get the address without the header). OK. From what I can tell, the top-level table, the one that picks the order of the song sections, goes from 791D-794D (inclusive). The world 1-1 song goes from 792D-794D inclusive. That place holds the first table. From that table, you add the number to 791E, and that byte and the byte after that point to another address. So, say you use 792D as an example. 792D = 8D 791E + 8D = 79AB 79AB = F9 79AC = FA the values at 79AB/79AC tell us to go to CPU address $FAF9 to get the string of notes in that section of the music. Convert CPU address to ROM address and you get $7B09. So $7B09 is where the song section we are dealing with starts. The 2nd pulse channel's string of notes will be listed first. $2C is octave 6 C (or octave 4 C in qbasic). every half step higher/lower is different by 2. So $2E is C#, $2A is octave 5 B, etc. 04 is a "rest note" (ie. silence). 80-87 are time length bytes. i'm not sure exactly how the length is worked out, but 84 is twice as long as 82, 85 is three times as long as 82, 86 is four times as long as 82. i'm not sure about the others, but I know 80 is really fast (it's used for the castle music) Pulse channel #2's string of notes starts where the song table states, and ends with an $00. The first pulse channel usually starts after the $00, and there will be a byte in the ROM, 2 bytes after the pointer to the string of notes (in our example's case, $79AE) that will say how many bytes after the beginning of the second pulse channel's string of notes the first pulse channel starts. In this case it is $0D after $7B09, or $7B16. Now pulse channel #1 works weird, in that it stores the time length and the note in the same byte. The first two and last byte are used for the time, and the others are used for the note. Here's two exampls, the first two notes starting at $7B16. $A0 = 10100000 $21 = 00100001 The last bit, and the first two bits make up the time. That makes the first one 010, or 2, and the second one, 100, or 4. The middle 5 bits (with a 0 tacked onto the end) make up the note. That makes the first one 100000, or 20, and 100000, or 20. The triangle channel usually starts after the pulse channel #1, however it will not be easy to tell where pulse channel #1 ends (because there is no $00 after it, everything works off of pulse channel #2's $00). There is a byte in the ROM one byte after the pointer to pulse channel #2, in our case $79AD, that says how many bytes after pulse channel #2 starts the triangle channel starts. In our case $79AD = 15, 7B09 + 15 = 7B1E. starts works almost the same way as pulse channel #2. it uses the 80-87 modifiers and the notes are the same way. however remember that the triangle channel and pulse #1 channel end when pulse #2 channel hits that $00. (Noise channel info) just like the first pulse channel and the triangle channel, there is a byte that indicates how many bytes after the beginning of the second pulse chan string the noise channel string begins. this byte is after the triangle byte that does the same thing. like the first pulse channel, the noise channel uses the middle 5 bytes for the note, and the first two and last byte for the length. there will be 4 possible values for the noise "note". 10,20,30, or 4. 4 is a pause just like in the other channels...10,20,and 30 will be the three different sounding drum beats. the noise string ends with a $00, and the string repeats until the music section is finished. i think that's all i remember about the noise channel part.